<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Exil:  Fichier source de src/Action.h</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Exil
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Généré par Doxygen 1.7.6.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Recherche');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Page&#160;principale</span></a></li>
      <li><a href="annotated.html"><span>Structures&#160;de&#160;données</span></a></li>
      <li class="current"><a href="files.html"><span>Fichiers</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Recherche" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>Liste&#160;des&#160;fichiers</span></a></li>
      <li><a href="globals.html"><span>Variables&#160;globale</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="headertitle">
<div class="title">src/Action.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_action_8h.html">Aller à la documentation de ce fichier.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 
<a name="l00008"></a>00008 <span class="preprocessor">#ifndef ACTION_H</span>
<a name="l00009"></a>00009 <span class="preprocessor"></span><span class="preprocessor">#define ACTION_H</span>
<a name="l00010"></a>00010 <span class="preprocessor"></span>
<a name="l00011"></a>00011 <span class="preprocessor">#include &quot;<a class="code" href="_entrepot_8h.html" title="Définit la structure de l&#39;entrepôt.">Entrepot.h</a>&quot;</span>
<a name="l00012"></a>00012 <span class="preprocessor">#include &quot;<a class="code" href="_carte_8h.html" title="Création et gestion de Cartes, structure comprenant notamment un tableau de cases.">Carte.h</a>&quot;</span>
<a name="l00013"></a>00013 
<a name="l00020"></a><a class="code" href="structs_action.html">00020</a> <span class="keyword">struct </span><a class="code" href="structs_action.html" title="Informations définissant une Action.">sAction</a>
<a name="l00021"></a>00021 {
<a name="l00022"></a><a class="code" href="structs_action.html#a26fc86988ebb0789dbe0358e0169e6bc">00022</a>    <span class="keywordtype">char</span> *<a class="code" href="structs_action.html#a26fc86988ebb0789dbe0358e0169e6bc">nomAction</a>;                     
<a name="l00024"></a><a class="code" href="structs_action.html#a9e87be90a6a30386639eeb4cec56cc2a">00024</a>    void (*<a class="code" href="structs_action.html#a9e87be90a6a30386639eeb4cec56cc2a">pFAct</a>)(<a class="code" href="struct_entrepot.html" title="Informations définissant l&#39;entrepôt.">Entrepot</a> *, <a class="code" href="struct_carte.html" title="Informations concernant un ensemble de cases.">Carte</a> *, int, <span class="keywordtype">unsigned</span> int, <span class="keywordtype">unsigned</span> int, <span class="keywordtype">unsigned</span> int);
<a name="l00025"></a><a class="code" href="structs_action.html#a18d76ff9235ca619107e2764b48d25cb">00025</a>    <span class="keywordtype">char</span> *<a class="code" href="structs_action.html#a18d76ff9235ca619107e2764b48d25cb">representation</a>;                
<a name="l00027"></a><a class="code" href="structs_action.html#a28ff3e88566245e4990dd159220fb289">00027</a>    <span class="keyword">struct </span><a class="code" href="structs_action.html" title="Informations définissant une Action.">sAction</a> *<a class="code" href="structs_action.html#a28ff3e88566245e4990dd159220fb289">actionSuivante</a>;      
<a name="l00028"></a>00028 };
<a name="l00029"></a>00029 
<a name="l00030"></a><a class="code" href="_action_8h.html#a7186d2fe0085d1d354cc50fafed6ae4d">00030</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structs_action.html" title="Informations définissant une Action.">sAction</a> <a class="code" href="structs_action.html" title="Informations définissant une Action.">Action</a>;
<a name="l00031"></a>00031 
<a name="l00032"></a>00032 
<a name="l00033"></a>00033 <span class="comment">/*======================== Gestion de la mémoire =======================*/</span>
<a name="l00039"></a>00039 <span class="keywordtype">void</span> <a class="code" href="_action_8c.html#a106e5177e2ab257222c550fd34989297" title="Initialise une structure Action.">initAction</a>(<a class="code" href="structs_action.html" title="Informations définissant une Action.">Action</a> *pact);
<a name="l00040"></a>00040 
<a name="l00046"></a>00046 <span class="keywordtype">void</span> <a class="code" href="_action_8c.html#a6cd1a099e9bdee3a8afada4e918302eb" title="Crée une Action.">creerAction</a>(<a class="code" href="structs_action.html" title="Informations définissant une Action.">Action</a> **pnouvAct);
<a name="l00047"></a>00047 
<a name="l00054"></a>00054 <span class="keywordtype">void</span> <a class="code" href="_action_8c.html#a66aed0770879674de8afcc0255ff9eb5" title="Libère la mémoire allouée aux champs de l&#39;action donnée.">libereAction</a>(<a class="code" href="structs_action.html" title="Informations définissant une Action.">Action</a> *pact);
<a name="l00055"></a>00055 
<a name="l00060"></a>00060 <span class="keywordtype">void</span> <a class="code" href="_action_8c.html#a946733ed058aa6c4c3a841515f365e8b" title="Libère la mémoire allouée pour une Action donnée.">detruireAction</a>(<a class="code" href="structs_action.html" title="Informations définissant une Action.">Action</a> *pact);
<a name="l00061"></a>00061 
<a name="l00062"></a>00062 <span class="comment">/*============================= Accesseurs =============================*/</span>
<a name="l00068"></a>00068 <span class="keywordtype">char</span> *<a class="code" href="_action_8c.html#a09305a52e4e038eb907efcbb366edf0c" title="Retourne le nom d&#39;une Action donnée.">getNomAction</a>(<span class="keyword">const</span> <a class="code" href="structs_action.html" title="Informations définissant une Action.">Action</a> *pact);
<a name="l00069"></a>00069 
<a name="l00075"></a><a class="code" href="_action_8h.html#a6645bb865d09687ed2dc12e7e0b00015">00075</a> void (*<a class="code" href="_action_8c.html#a6645bb865d09687ed2dc12e7e0b00015">getFonctionAction</a>(<span class="keyword">const</span> <a class="code" href="structs_action.html" title="Informations définissant une Action.">Action</a> *pact)) (<a class="code" href="struct_entrepot.html" title="Informations définissant l&#39;entrepôt.">Entrepot</a> *, <a class="code" href="struct_carte.html" title="Informations concernant un ensemble de cases.">Carte</a> *, int, <span class="keywordtype">unsigned</span> int, <span class="keywordtype">unsigned</span> int, <span class="keywordtype">unsigned</span> int);
<a name="l00076"></a>00076 
<a name="l00083"></a>00083 <span class="keywordtype">char</span> *<a class="code" href="_action_8c.html#a7bedd108f96dca52e972956e9d803e0c" title="Retourne le nom de l&#39;image permettant de représenter l&#39;action donnée.">getRepresentationAction</a>(<span class="keyword">const</span> <a class="code" href="structs_action.html" title="Informations définissant une Action.">Action</a> *pact);
<a name="l00084"></a>00084 
<a name="l00090"></a>00090 <a class="code" href="structs_action.html" title="Informations définissant une Action.">Action</a> *<a class="code" href="_action_8c.html#adb02073f00d962ca6403d6d96f013d45" title="Retourne un pointeur vers l&#39;action suivante d&#39;une action donnée.">getActionSuivanteAction</a>(<span class="keyword">const</span> <a class="code" href="structs_action.html" title="Informations définissant une Action.">Action</a> *pact);
<a name="l00091"></a>00091 
<a name="l00092"></a>00092 <span class="comment">/*============================== Mutateurs =============================*/</span>
<a name="l00098"></a>00098 <span class="keywordtype">void</span> <a class="code" href="_action_8c.html#a4c7f3028936af90dd819039f6217de2c" title="Remplace le nom d&#39;une Action donnée par un nouveau nom.">setNomAction</a>(<a class="code" href="structs_action.html" title="Informations définissant une Action.">Action</a> *pact, <span class="keywordtype">char</span> *nouvNom);
<a name="l00099"></a>00099 
<a name="l00106"></a>00106 <span class="keywordtype">void</span> <a class="code" href="_action_8c.html#ae44b9859e56351c31c18f06445eb3e41" title="Remplace le pointeur sur fonction d&#39;une action donnée par un nouveau pointeur sur fonction passé en p...">setFonctionAction</a>(<a class="code" href="structs_action.html" title="Informations définissant une Action.">Action</a> *pact, <span class="keywordtype">void</span> (*<a class="code" href="structs_action.html#a9e87be90a6a30386639eeb4cec56cc2a">pFAct</a>)(<a class="code" href="struct_entrepot.html" title="Informations définissant l&#39;entrepôt.">Entrepot</a> *, Carte *, <span class="keywordtype">int</span>, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>));
<a name="l00107"></a>00107 
<a name="l00114"></a>00114 <span class="keywordtype">void</span> <a class="code" href="_action_8c.html#aa7657d612129d80cd0b9bf4a42946d12" title="Remplace le nom de la représentation d&#39;une Action donnée par un nouveau nom.">setRepresentationAction</a>(<a class="code" href="structs_action.html" title="Informations définissant une Action.">Action</a> *pact, <span class="keywordtype">char</span> *nouvRepres);
<a name="l00115"></a>00115 
<a name="l00122"></a>00122 <span class="keywordtype">void</span> <a class="code" href="_action_8c.html#a88179b7fa7a7c62b8f36fd7ff93b4e3b" title="Remplace le contenu du champ actionSuivante d&#39;une Action donnée par un pointeur vers action passé en ...">setActionSuivanteAction</a>(<a class="code" href="structs_action.html" title="Informations définissant une Action.">Action</a> *pact, <a class="code" href="structs_action.html" title="Informations définissant une Action.">Action</a> *pactSuiv);
<a name="l00123"></a>00123 
<a name="l00124"></a>00124 <span class="comment">/*===================== Jouer la fonction du champ =====================*/</span>
<a name="l00140"></a>00140 <span class="keywordtype">void</span> <a class="code" href="_action_8c.html#a8dd83d31c261c659884f835ea96dd306" title="Execute la fonction pointée par le champ pFAct d&#39;une action donnée.">executeFonctionAction</a>(<a class="code" href="structs_action.html" title="Informations définissant une Action.">Action</a> *pact, <a class="code" href="struct_entrepot.html" title="Informations définissant l&#39;entrepôt.">Entrepot</a> *pstock, Carte *pcarte, <span class="keywordtype">int</span> modif, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> x, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> y, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> z);
<a name="l00141"></a>00141 
<a name="l00142"></a>00142 
<a name="l00143"></a>00143 <span class="comment">/*============================ Les fonctions ============================*/</span>
<a name="l00144"></a>00144 
<a name="l00159"></a>00159 <span class="keywordtype">void</span> <a class="code" href="_action_8c.html#afb2798a7b3f6ccd5d9ceca8d3cd82dd1" title="Fonction décrivant l&#39;inaction d&#39;un nain.">inactif</a>(<a class="code" href="struct_entrepot.html" title="Informations définissant l&#39;entrepôt.">Entrepot</a> *pstock, Carte *pcarte, <span class="keywordtype">int</span> modif, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> x, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> y, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> z);
<a name="l00160"></a>00160 
<a name="l00175"></a>00175 <span class="keywordtype">void</span> <a class="code" href="_action_8c.html#a380e7d39713927b6c9fb33bdfd1ade60" title="Fonction décrivant l&#39;action de récolte de bois.">recolteBois</a>(<a class="code" href="struct_entrepot.html" title="Informations définissant l&#39;entrepôt.">Entrepot</a> *pstock, Carte *pcarte, <span class="keywordtype">int</span> modif, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> x, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> y, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> z);
<a name="l00176"></a>00176 
<a name="l00192"></a>00192 <span class="keywordtype">void</span> <a class="code" href="_action_8c.html#a6bd18512d723a5ef5783166eaa927b94" title="Fonction décrivant l&#39;action de fin de récolte de bois.">finRecolteBois</a>(<a class="code" href="struct_entrepot.html" title="Informations définissant l&#39;entrepôt.">Entrepot</a> *pstock, Carte *pcarte, <span class="keywordtype">int</span> modif, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> x, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> y, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> z);
<a name="l00193"></a>00193 
<a name="l00194"></a>00194 
<a name="l00209"></a>00209 <span class="keywordtype">void</span> <a class="code" href="_action_8c.html#aa93148854d9f71f6e0f652a3fad61577" title="Fonction décrivant l&#39;action de récolte de metal.">recolteMetal</a>(<a class="code" href="struct_entrepot.html" title="Informations définissant l&#39;entrepôt.">Entrepot</a> *pstock, Carte *pcarte, <span class="keywordtype">int</span> modif, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> x, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> y, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> z);
<a name="l00210"></a>00210 
<a name="l00226"></a>00226 <span class="keywordtype">void</span> <a class="code" href="_action_8c.html#aa8682a788d553032cf427d7e667e1859" title="Fonction décrivant l&#39;action de fin de récolte de métal.">finRecolteMetal</a>(<a class="code" href="struct_entrepot.html" title="Informations définissant l&#39;entrepôt.">Entrepot</a> *pstock, Carte *pcarte, <span class="keywordtype">int</span> modif, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> x, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> y, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> z);
<a name="l00227"></a>00227 
<a name="l00228"></a>00228 
<a name="l00229"></a>00229 <span class="comment">/*========================== Fonctions autres ==========================*/</span>
<a name="l00239"></a>00239 <a class="code" href="structs_action.html" title="Informations définissant une Action.">Action</a> *<a class="code" href="_action_8c.html#a0bfec079c0757a5e88d008762f2a7009" title="Crée une Action à partir des données fournies et renvoie un pointeur pointant dessus.">creerCompleteAction</a>(<span class="keywordtype">char</span> *nom, <span class="keywordtype">char</span> *repres, <span class="keywordtype">void</span> (*<a class="code" href="structs_action.html#a9e87be90a6a30386639eeb4cec56cc2a">pFAct</a>)(<a class="code" href="struct_entrepot.html" title="Informations définissant l&#39;entrepôt.">Entrepot</a> *, Carte *, <span class="keywordtype">int</span>, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span>));
<a name="l00240"></a>00240 
<a name="l00241"></a>00241 <span class="comment">/*========================== Fonction de Test ==========================*/</span>
<a name="l00247"></a>00247 <span class="keywordtype">void</span> <a class="code" href="_action_8c.html#a3dbf74f9feb14ff872e23951386139e1" title="Teste les différentes fonctions du module Action.">testAction</a>();
<a name="l00248"></a>00248 
<a name="l00249"></a>00249 
<a name="l00250"></a>00250 <span class="preprocessor">#endif</span>
</pre></div></div><!-- contents -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>Tout</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Structures de données</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Fichiers</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Fonctions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Définitions de type</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Généré le Mardi Juin 4 2013 00:35:14 pour Exil par &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>

</body>
</html>
